1) Field of the Invention
The present invention relates to a method of and an apparatus for decoding and displaying video data of an encoded motion picture.
2) Description of the Related Art
The encoding of a motion picture is carried out based on the MPEG-2 (Moving Picture Experts Group 2) as the international standard. In the video decoding and displaying apparatus that decodes video data of an encoded motion picture and displays the decoded video, how to use a frame memory is important. Various kinds of proposals have been made so far regarding methods:of controlling the frame memory. For example, Japanese Patent Application Laid-open Publication No. 8-107482, and Japanese Patent Application Laid-open Publication No. 9-284779 disclose such methods.
The conventional method of controlling the frame memory will be now explained with reference to FIG. 12 to FIG. 15. FIG. 12 is a block diagram of a conventional video decoding and displaying apparatus. FIG. 13 is an illustration of a relationship between video data and sectors in a bank #2 of the frame memory shown in FIG. 12. FIG. 14 is a block diagram of a sector managing apparatus in a frame-memory control-section (that is, a frame memory interface) shown in FIG. 12. FIG. 15 is a time chart of an operation of the conventional video decoding and displaying apparatus in a one-sector release mode, and explains about a transition of a used quantity of sectors.
The conventional video decoding and displaying apparatus includes a sequencer (SEQ) 101, a video decoding-section (VDEC) 102, a frame-memory control-section (FIF) 103, a frame memory 104, and a video interface section (VIF) 105. The dotted line arrows illustrate flow of video data, and thin solid line arrows illustrate control instructions or control information signals.
The sequencer 101 controls each section of the video decoding and displaying apparatus according to operation mode instructions from the outside. In other words, the sequencer 101 outputs a control instruction (a) to the video decoding-section 102, thereby to instruct the video decoding-section 102 to start or stop video decoding. The sequencer 101 receives frame-memory management information (b) that includes a display output line and sector management information, from the frame-memory control-section 103. The sequencer 101 outputs a control instruction (c) to the frame-memory control-section 103, thereby to instruct the frame-memory control-section 103 to write a decoded video into a bank, or read a display video from a bank, or manage a sector of the bank #2.
The video decoding-section 102 decodes encoded video data that is input from the outside, and outputs the generated decoded video data to the frame-memory control-section 103. The frame-memory control-section 103 writes the decoded video data transferred from the video decoding-section 102, into the frame memory 104. The frame-memory control-section 103 also reads the decoded video data from the frame memory 104, and outputs this data to the video interface section 105. The video interface section 105 converts a format of the decoded video data transferred from the frame-memory control-section 103, thereby to generate display video data, and outputs this display video data to an external display apparatus.
The frame memory 104 consists of three banks (i.e., #0, #1, and #2). Each of the bank #0 and the bank #1 has a capacity to store video data of one frame component, and is used to store an I frame and a P frame that are used as predicted videos. The bank #2 is used to store a frame not used for a predicted video, that is, a B frame in a normal video reproduction. The bank #2 is managed by being divided into a plurality of sectors (i.e., a sector #0 to a sector #m) as shown in FIG. 12. A divided number of sectors can be variable set in a capacity of at least 0.5 frame.
FIG. 13 illustrates a relationship between video data and sectors in the bank #2 of the frame memory 104. FIG. 13 is an illustration of this relationship corresponding to an NTSC (National Television System Committee) size, where the resolution of one frame is 720 pixels by 480 pixels.
As shown in FIG. 13, 16 pixels in top-field (top) eight lines, and 16 pixels in bottom-field (bottom) eight lines constitute a macro block 120. The macro block 120 is the smallest unit for encoding data.
One sector of the top field (top) constitutes 720 pixels in the top-field eight lines. Moreover, one sector of the bottom-field (bottom) constitutes 720 pixels in the bottom field (bottom) eight lines. Data of 45 macro blocks (hereinafter “macro block lines”) are stored in a horizontal direction, using each one sector as a unit.
The frame-memory control-section 103 includes a sector managing apparatus shown in FIG. 14. The sector managing apparatus writes decoded video into and read decoded video from the bank #2 of the frame memory 104 respectively.
The sector managing apparatus includes a sector managing circuit 131, and a sector management table 132. The sector management table 132 holds a plurality of sector information (#0 to #m). Each sector information includes vertical address information (i.e., a vertical address) 133 in the frame of the video data stored in the sector, field parity information (i.e., top or bottom) 134 that indicates whether the field is a top field or a bottom field, frame number information (i.e., a frame number) 135 that is used to identify a frame number when data of two frames coexist in the bank #2, and used-flag information (i.e., used flag) 136 that indicates whether a sector is free or in use.
The sector managing apparatus operates in a fixed mapping mode and a dynamic mapping mode. As the present invention relates to the dynamic mapping mode, only the dynamic mapping mode will be explained.
When the sector managing apparatus is operating in the dynamic mapping mode, the sector managing circuit 131 searches the sector management table 132 for an unused sector to write new macro block lines of decoded video data into the frame memory 104. The sector managing circuit 131 outputs a sector number of the unused sector to the outside. Moreover, the sector managing circuit 131 updates sector management information corresponding to this sector, and sets this sector to be in use. This operation is called a sector allocation.
The frame-memory control-section 103 converts the unused sector number obtained by the searching, into a writing position of the frame memory 104, and writes the decoded video data into this position. To read the video data to be displayed, the frame-memory control-section 103 searches the sector management table 132 for a sector that stores the video data corresponding to the display line. The frame-memory control-section 103 outputs a sector number of the obtained sector to the outside, reads the display data from this sector, and outputs this display data. Upon completing the outputting of all the data, the frame-memory control-section 103 resets the used flag of this sector. This resetting operation is called a sector release. The sector managing circuit 131 manages the information of a number of used sectors, and outputs a flag (i.e., a sector full flag) that indicates whether all the sectors are being used, to the outside.
FIG. 15 illustrates a relationship between a decoded frame, a display frame, a decoding bank, a display bank, a sector initialization instruction, a sector allocation instruction, a sector release instruction, and a used quantity of sectors, for each of field periods from T0 to T15.
In the upper part of FIG. 15, “top” and “bot” denote field parities of a video output respectively. “I” denotes an Intra-coded frame (i.e., an I frame) that is encoded within a frame with no intra-frame predictive coding. “P” denotes a Predictive-coded frame (i.e., a P frame) that is intra-frame predictive coded in one direction. The P frame has an intra-frame predictive coding from the preceding I frame or P frame. “B” denotes a Bidirectional predictive-coded frame (i.e., a B frame) that is intra-frame predictive coded in both directions. The B frame has an intra-frame predictive coding from the preceding and following I frame or P frame.
A number (*) attached next to each of I, P, and B denotes a display order of the frame. “I*t” and “I*b” denote a top field of the I* frame and a bottom field of the I* frame respectively. Similarly, “P*t” and “P*b” denote a top field of the P* frame and a bottom field of the P* frame respectively. Also, “B*t” and “B*b” denote a top field of the B* frame and a bottom field of the B* frame respectively.
The “decoding bank” denotes a bank of the frame memory 104 into which the decoded frame is written. In the example shown in FIG. 15, the I2 frame is instructed to be written into the bank #0, and the P5 frame is instructed to be written into the bank #1. As shown in FIG. 15, as none of the B frames are used for the predictive video, all the B frames are instructed to be written into the bank #2.
The “display bank” denotes a bank from which the video data is read to carry out a display. In the example shown in FIG. 15, at the time of displaying the I2 frame after displaying the B1 frame, the 12 frame is stored in the bank #0. Therefore, the bank #0 is instructed as the “display bank”.
The “sector allocation instruction” is a control signal that is output from the sequencer 101 to the frame-memory control-section 103. The “sector allocation instruction” becomes at a “1” level during a field period when the decoded video is written into the frame memory 104, and becomes at a “0” level during a field period when the decoded video is not written into the frame memory 104. In FIG. 15, all the frames are decoded during every two field periods. Therefore, the “sector allocation instruction” is always at the “1” level.
When the “sector allocation instruction” is at the “1” level, the frame-memory control-section 103 searches the sector management table 132 for a free sector, and writes the decoded video data into this free sector. At the same time, the frame-memory control-section 103 rewrites the state of the writing section into a busy state, and updates the writing video information such as the video position and the field parity, in the sector management table 132.
The “sector release instruction” is a control signal that is output from the sequencer 101 to the frame-memory control-section 103. During a dynamic mapping mode, the frame-memory control-section 103 releases the sector according to the “sector release instruction”. Specifically, the “sector release instruction” changes in the unit of one field period. During a display field period when the “sector release instruction” is at the “1” level, the frame-memory control-section 103 releases the sector when all the data of the sector are output to be displayed. On the other hand, during a display field period when the “sector release instruction” is at the “0” level, the frame-memory control-section 103 does not release the sector, and holds the data. In FIG. 15, as the “sector release instruction” is always at the “1” level, the frame-memory control-section 103 releases a sector at every one sector.
The decoding of the B9 frame starts during the field period T2. As the “sector allocation instruction” is at the “1” level, the decoding of both the top and bottom fields progresses. The decoded data are sequentially written into free sectors of the bank #2. At the same time, information about the writing sector is updated in the sector management table 132.
As a result, the number of busy sectors increases. At the end of the field period T2, about a half of the data is decoded in each field. Therefore, total number of busy sectors corresponds to about one field. The frame-memory control-section 103 starts writing the B9 frame immediately after the sector is initialized by the “sector initialization instruction” at the starting time of the field period T1. Therefore, the frame-memory control-section 103 starts writing all the data of the B9 frame in the state that the sector is free.
In the next field period T3, the B9 frame is continuously decoded, and the top field B9t of the B9 field is displayed. To read the display data from the frame memory 104, the frame-memory control-section 103 searches for a sector that stores the data of the top field B9t, and displays the data. In this case, the “sector release instruction” is at the “1” level. Therefore, at a point of time when the frame-memory control-section 103 completes reading the whole data within the sector, the frame-memory control-section 103 updates the information about the sector in the sector management table 132, and releases this sector as a free sector.
The frame-memory control-section 103 continuously decodes the data of the top field B9t of the B9 frame, and at the same time, reads the data of one field during the field period T3. Therefore, the used quantity of the sector finally becomes zero at the end of the field period T3. On the other hand, the frame-memory control-section 103 finishes the decoding, and does not start the display, of the data of the bottom field B9t of the B9 frame. Therefore, the frame-memory control-section 103 is still using the sector of one field component.
In the next field period T4, the frame-memory control-section 103 decodes the next B10 frame, and at the same time, displays the bottom field B9b of the B9 frame. Both the “sector allocation instruction” and the “sector release instruction” are at the “1” level. Therefore, the frame-memory control-section 103 carries out both the writing of the decoded video into the sector and the reading of the display data from the sector, in a similar manner to that for the B9 frame. Consequently, the number of sectors used for the data of the bottom field B9b of the B9 frame gradually decreases along the progress of the display. At the same time, the number of sectors used for the data of both the top field B10t and the bottom field B10b of the B10 frame gradually increases.
In the next field period T5, the frame-memory control-section 103 continuously decodes the B10 frame, and at the same time, displays the top field B10t of the B10 frame. Therefore, the number of sectors used for the data of the top field B10t of the B10 frame gradually decreases. At the end of the field period T5, only the data of the bottom field B10b of the B10 frame is using the sector of one field component.
In the next field period T6, the frame-memory control-section 103 does not write new decoded video data into the bank #2, and displays only the bottom field B10b of the B10 frame. Therefore, the frame-memory control-section 103 reads the remaining data of the bottom field B10b, and releases the sectors. At the end of the field period T6, the frame-memory control-section 103 completes the display, and sets all the sectors free.
During the field periods from T2 to T6, when there is no free sector in the bank #2, the frame-memory control-section 103 must stop writing the decoded video data. Therefore, the frame-memory control-section 103 outputs a sector using state to the sequencer 101. The sequencer 101 refers to the received sector using state, and when all the sectors are busy, the sequencer 101 makes the video decoding-section 102 stop decoding.
The conventional method is advantageous in that a frame memory, which is necessary for decoding and displaying a video, of lower capacity is sufficient. The data during the field period after finishing the display is released during this field period. Therefore, when the display video is an interlace material, there is no problem. However, when the display video is a progressive material, it is not possible to display the video in an optimum format.
Further, in the conventional method, it is not possible to display a picture of an SIF size in an enlarged size. Therefore, it is not possible to continuously decode and display various videos in the dynamic mapping mode.